class Solution {
    public int[] twoSum(int[] numbers, int target) {
        for(int i = 0;i  < numbers.length;i++) {
            int left = i + 1;
            int rigth = numbers.length - 1;
            while (left <= rigth) {
                int mid = (rigth - left) / 2 + left;
                if(numbers[mid] == target - numbers[i]) {
                    return new int[]{i,mid};
                } else if (numbers[mid] > target - numbers[i]) {
                    rigth = mid - 1;
                } else {
                    left = mid + 1;
                }
            }
        }
        return new int[]{-1,-1};
    }
}